//
//  YZPigDeathDetailRecordAudioCell.m
//  VET
//
//  Created by YZ on 2018/7/26.
//  Copyright © 2018年 YZ. All rights reserved.
//

#import "YZPigDeathDetailRecordAudioCell.h"
#import "YZNoteAudioDisplayBtn.h"

@interface YZPigDeathDetailRecordAudioCell()

@property (nonatomic, strong) YZNoteAudioDisplayBtn *audioDisplayBtn;

@end

@implementation YZPigDeathDetailRecordAudioCell

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        self.layer.masksToBounds = YES;
        [self.contentView addSubview:self.audioDisplayBtn];
        
        [self makeContraints];
    }
    return self;
}

- (void)makeContraints
{
    [self.audioDisplayBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(kCurrentDeviceNum(10));
        make.right.equalTo(self.contentView.mas_right).offset(-kCurrentDeviceNum(10));
        make.height.mas_equalTo(kCurrentDeviceNum(40));
        make.bottom.equalTo(self.contentView.mas_bottom).offset(-kCurrentDeviceNum(10));
    }];
}


#pragma mark-- setters && getters

- (YZNoteAudioDisplayBtn *)audioDisplayBtn
{
    if (!_audioDisplayBtn) {
        _audioDisplayBtn = [[YZNoteAudioDisplayBtn alloc] initWithDisplayType:YZNoteAudioDisplayNoteList audioUrl:@"aa"];
    }
    return _audioDisplayBtn;
}

- (void)setModel:(YZPigDeathDetailRecordAttachmentModel *)model
{
    _model = model;
    self.audioDisplayBtn.audioUrl = model.attachmentUrl;
}
@end
